﻿class preload {
    public static load() {
        return WinJS.Promise.join([
            preload.loadSingle("scrollProgress"),
            preload.loadSingle("scroll"),
            preload.loadSingle("msGesture"),
            preload.loadSingle("thisElem"),
            preload.loadSingle("myZoom"),
            preload.loadSingle("CustomManipulation/GestureRoot"),
            preload.loadSingle("CustomManipulation/CustomScroll"),
            preload.loadSingle("CustomManipulation/CustomZoom"),
            preload.loadSingle("CustomManipulation/Tap"),
            preload.loadSingle("CustomManipulation/Hold"),
            preload.loadSingle("CustomManipulation/Release"),
            preload.loadSingle("CustomManipulation/Drag")
        ]);
    }

    private static loadSingle(name: string) {
        return new WinJS.Promise((complete) => {
            var arr = ["bindingHandlers/" + name];

            require(
                arr, (handler) => {
                    handler.create();
                    complete();
                }
            );
        });
    }
}

export = preload 